
$(function(){
	//选择姓名，显示信息
$(".list").on('click','.show',function(){
  	var target=$(this);
	var eid=target.attr("eid");
	$.get("changedriver", {
		eid : eid,
	}, function(massage) {
		var json=$.parseJSON(massage);
		$(".details img").attr("src","statics/image/upload/employee/"+json.ephoto);
		$(".infor .ename").text(json.ename);
		$(".infor .tel").text(json.etel);
		$(".infor .bir").text(formatterDate (json.ebir));
		$(".details .summary").text(json.editor);
	});
	
});
		//时间格式化
 function formatterDate (date) {
	    var datetime =new Date(date);
	    var year = datetime.getFullYear();
	    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
	    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
	    return year + "-" + month + "-" + date;
}
   //模糊查询，显示姓名
$(".select").on("click",".search",function(){
	var val=$(".select .xing").val();
	$("table tr").remove();
	$.get("findname", {
		val : val,
	}, function(massage) {
		var json=$.parseJSON(massage);
		$.each(json,function(i,item){
			$("table").append("<tr><td class=show eid="+item.eid+">"+item.ename+"</td></tr>");
		});
	});

});


});